
<!-- Cloud Storage service_accounts partial -->
<script id="services.iam.projects.id.service_accounts.partial" type="text/x-handlebars-template">
    <div id="resource-name" class="list-group-item active">
        <h4 class="list-group-item-heading">{{name}}</h4>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading">Information</h4>
        <div class="list-group-item-text item-margin">ID: <span id="iam.projects.{{@../key}}.service_accounts.{{@key}}.id"><samp>{{id}}</samp></span></div>
        <div class="list-group-item-text item-margin">Project ID: <span id="iam.projects.{{@../key}}.service_accounts.{{@key}}.project_id"><samp>{{project_id}}</samp></span></div>
        <div class="list-group-item-text item-margin">Email: <span id="iam.projects.{{@../key}}.service_accounts.{{@key}}.email"><samp>{{email}}</samp></span></div>
        <div class="list-group-item-text item-margin">Display Name: <span id="iam.projects.{{@../key}}.service_accounts.{{@key}}.display_name"><samp>{{display_name}}</samp></span></div>
        <div class="list-group-item-text item-margin">Default Service Account: <span id="iam.projects.{{@../key}}.service_accounts.{{@key}}.default_service_account"><samp>{{default_service_account}}</samp></span></div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading"><span id="iam.projects.{{@../key}}.service_accounts.{{@key}}.keys">Keys:</span></h4>
        <div class="accordion-inner">
            <ul>
                {{#each keys}}
                <li>Key <samp>{{@key}}</samp></li>
                <ul>
                    <li id="iam.projects.{{@../../key}}.service_accounts.{{@../key}}.keys.{{@key}}.key_type">Key Type: <samp>{{key_type}}</samp></li>
                    <li id="iam.projects.{{@../../key}}.service_accounts.{{@../key}}.keys.{{@key}}.algorithm">Key Algorithm: <samp>{{key_algorithm}}</samp></li>
                    <li id="iam.projects.{{@../../key}}.service_accounts.{{@../key}}.keys.{{@key}}.valid_before">Valid Before: {{format_date valid_before}}</li>
                    <li id="iam.projects.{{@../../key}}.service_accounts.{{@../key}}.keys.{{@key}}.valid_after">Valid After: {{format_date valid_after}}</li>
                </ul>
                {{else}}
                <li><samp>None</samp></li>
                {{/each}}
            </ul>
        </div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading"><span id="iam.projects.{{@../key}}.service_accounts.{{@key}}.bindings">Service Account Users:</span></h4>
        <div class="accordion-inner">
            <ul>
                {{#each bindings}}
                <li>Role <samp>{{role}}</samp></li>
                <ul>
                    {{#each members}}
                    <li><samp>{{this}}</samp></li>
                    {{/each}}
                </ul>
                {{else}}
                <li><samp>None</samp></li>
                {{/each}}
            </ul>
        </div>
    </div>
</script>

<script>
    Handlebars.registerPartial("services.iam.projects.id.service_accounts", $("#services\\.iam\\.projects\\.id\\.service_accounts\\.partial").html());
</script>

<!-- Single iam service_account template -->
<script id="single_iam_service_account-template" type="text/x-handlebars-template">
    {{> modal-template template='services.iam.projects.id.service_accounts'}}
</script>
<script>
    var single_iam_service_account_template = Handlebars.compile($("#single_iam_service_account-template").html());
</script>
